public class Compressor
{
   public String compressImage(String imageColors)
   {
      // your work here   
      int l = imageColors.length();
      int k = 1;
      String result = "";
      for(int i = 1;i < l;i++){
         char ch1 = imageColors.charAt(i),ch2 = imageColors.charAt(i-1);
         if(ch1 == ch2)
            k+=1;
         else{
            result = result + k + ch2;
            k=1;
         }
      }
      result = result + k + imageColors.charAt(l-1);
      return result;
   } 
}